package cn.hg.solon.youcan.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class SysUserTableDef extends TableDef {

    /**
     * 实体类。

 @author 胡高
 @since 2023-06-20
     */
    public static final SysUserTableDef SYS_USER = new SysUserTableDef();

    /**
     * ID
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 加密盐
     */
    public final QueryColumn SALT = new QueryColumn(this, "salt");

    /**
     * 用户类型（SYSTEM 系统用户，REGISTE注册用户）
     */
    public final QueryColumn TYPE = new QueryColumn(this, "type");

    /**
     * 用户邮箱
     */
    public final QueryColumn EMAIL = new QueryColumn(this, "email");

    /**
     * 删除标志（true 是，false 否）
     */
    public final QueryColumn IS_DEL = new QueryColumn(this, "is_del");

    /**
     * 手机号码
     */
    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    /**
     * 头像路径
     */
    public final QueryColumn AVATAR = new QueryColumn(this, "avatar");

    /**
     * 部门ID
     */
    public final QueryColumn DEPT_ID = new QueryColumn(this, "dept_id");

    /**
     * 更新者
     */
    public final QueryColumn EDITOR = new QueryColumn(this, "editor");

    /**
     * 用户性别（M 男，F 女，U 未知）
     */
    public final QueryColumn GENDER = new QueryColumn(this, "gender");

    /**
     * 备注
     */
    public final QueryColumn REMARK = new QueryColumn(this, "remark");

    /**
     * 帐号状态（ON 正常，OFF 停用）
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 账号
     */
    public final QueryColumn ACCOUNT = new QueryColumn(this, "account");

    /**
     * 创建者
     */
    public final QueryColumn CREATOR = new QueryColumn(this, "creator");

    /**
     * 最后登录IP
     */
    public final QueryColumn LOGIN_IP = new QueryColumn(this, "login_ip");

    /**
     * 昵称
     */
    public final QueryColumn NICKNAME = new QueryColumn(this, "nickname");

    /**
     * 密码
     */
    public final QueryColumn PASSWORD = new QueryColumn(this, "password");

    /**
     * 最后登录时间
     */
    public final QueryColumn LOGIN_DATETIME = new QueryColumn(this, "login_datetime");

    /**
     * 更新时间
     */
    public final QueryColumn EDITED_DATETIME = new QueryColumn(this, "edited_datetime");

    /**
     * 创建时间
     */
    public final QueryColumn CREATED_DATETIME = new QueryColumn(this, "created_datetime");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, SALT, TYPE, EMAIL, IS_DEL, PHONE, AVATAR, DEPT_ID, EDITOR, GENDER, REMARK, STATUS, ACCOUNT, CREATOR, LOGIN_IP, NICKNAME, PASSWORD, LOGIN_DATETIME, EDITED_DATETIME, CREATED_DATETIME};

    public SysUserTableDef() {
        super("", "sys_user");
    }

    private SysUserTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public SysUserTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new SysUserTableDef("", "sys_user", alias));
    }

}
